/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreClbyjl extends BasicModel<CoreClbyjl> {
  clbyjlCph?: string; // 车牌号
  clbyjlPpxh?: string; // 品牌型号
  clbyjlClsbdm?: string; // 车辆识别代码
  clbyjlFdjhm?: string; // 发动机号码
  clbyjlByrq?: string; // 保养日期
  clbyjlByr?: string; // 保养人
  clbyjlBygls?: number; // 保养公里数
  clbyjlByxm?: string; // 保养项目
  clbyjlByfwdw?: string; // 保养服务单位
  clbyjlByfy?: number; // 保养费用
  clbyjlXcbygls?: number; // 下次保养公里数
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const coreClbyjlList = (params?: CoreClbyjl | any) =>
  defHttp.get<CoreClbyjl>({ url: adminPath + '/cardd/byjl/coreClbyjl/list', params });

export const coreClbyjlListData = (params?: CoreClbyjl | any) =>
  defHttp.post<Page<CoreClbyjl>>({ url: adminPath + '/cardd/byjl/coreClbyjl/listData', params });

export const coreClbyjlForm = (params?: CoreClbyjl | any) =>
  defHttp.get<CoreClbyjl>({ url: adminPath + '/cardd/byjl/coreClbyjl/form', params });

export const coreClbyjlSave = (params?: any, data?: CoreClbyjl | any) =>
  defHttp.postJson<CoreClbyjl>({ url: adminPath + '/cardd/byjl/coreClbyjl/save', params, data });

export const coreClbyjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/byjl/coreClbyjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreClbyjlDelete = (params?: CoreClbyjl | any) =>
  defHttp.get<CoreClbyjl>({ url: adminPath + '/cardd/byjl/coreClbyjl/delete', params });
